#ifndef _MQTTCLIENT_CONNECTMANAGER_H_
#define _MQTTCLIENT_CONNECTMANAGER_H_

#include <QDialog>

namespace Ui
{
	class ConnectManager;
}
class CDataCtrl;
class QMenu;
class QTableWidgetItem;

class CConnectManager : public QDialog
{
	Q_OBJECT
public:
	CConnectManager(CDataCtrl *pCtrl, QWidget *parent = nullptr);
	~CConnectManager();

private:
	void init();
	void setOpenStatus();

signals:
	void sigInsertGroup(QString, QString);
	void sigUpdateGroup(QString, QString);
	void sigDeleteGroup(QString);
	void sigOpenConnect(QString);

private slots:
	void on_btnNewGroup_clicked();
	void on_btnNewConnect_clicked();
	void on_tbGroup_itemChanged(QTableWidgetItem*);
	void on_tbGroup_customContextMenuRequested(const QPoint&);
	void on_tbGroup_itemClicked(QTableWidgetItem*);
	void slotDeleteGroup();
	void on_tbConnect_itemClicked(QTableWidgetItem*);
	void on_cBoxOpenThis_stateChanged(int state);
	void on_btnConnect_clicked();
	void on_btnClose_clicked();

private:
	Ui::ConnectManager *m_ui;
	CDataCtrl *m_pCtrl;
	QMenu *m_pMenu;
	int m_selectRow;
	bool m_isModifyGroupName;
};
#endif
